package demo2;

public class Test4 {
    public static void main(String[] args) throws InterruptedException {
        Thread m1 = Thread.currentThread();
        Thread t1 = new Thread(()->{
            while (true){
                System.out.println(m1.getState());
            }
        });
        t1.start();
        t1.join(5000);
        System.out.println(t1.getState());



    }
}
